package com.wuyancheng.service.impl;

import com.wuyancheng.cache.LoginCache;
import com.wuyancheng.service.ILoginService;
import org.springframework.stereotype.Service;


@Service
public class LoginServiceImpl implements ILoginService {

    private static final String ADMIN = "admin";

    @Override
    public boolean checkPermission(String username, String password) {
        if(ADMIN.equals(username)&& ADMIN.equals(password)){
            LoginCache.addName(ADMIN);
            return true;
        }
        return false;
    }

}
